package com.web.common.iot.mqtt.api;

import javax.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.web.common.api.config.ServiceInstanceName;
import com.web.common.iot.mqtt.entity.MqttUser;
import com.web.common.iot.mqtt.entity.MqttUserEntity;
import com.web.common.result.R;

/**
 * <p>
 * 
 * </p>
 *
 * @author zhouhui
 * @since 2024-01-05
 */
 @FeignClient(name = ServiceInstanceName.SERVICE_IOT_NAME, contextId = "mqttUserApi", path = "/iot/mqttUser")
 public interface MqttUserApi {
 	
 	/**
 	 * 按照条件查询数据列表
	 * @param condition 查询条件
	 *
	 * @author zhouhui
	 * @since 2024-01-05
	 */
 	@PostMapping(path = "/list")
	@ResponseBody
 	R<IPage<MqttUserEntity>> getList(@RequestBody MqttUserEntity condition);
 	
 	/**
 	 * 保存数据信息
	 * @param mqttUser 数据信息
	 *
	 * @author zhouhui
	 * @since 2024-01-05
	 */
 	@PostMapping(path = "/save")
	@ResponseBody
 	R<Object> saveInfo(@Valid @RequestBody MqttUser mqttUser);
 	
 	/**
 	 * 更新数据信息
	 * @param mqttUser 数据信息
	 *
	 * @author zhouhui
	 * @since 2024-01-05
	 */
 	@PostMapping(path = "/update")
	@ResponseBody
 	R<Object> updateInfo(@Valid @RequestBody MqttUser mqttUser);
 	
 	/**
 	 * 删除数据信息
	 * @param mqttUser 数据信息
	 *
	 * @author zhouhui
	 * @since 2024-01-05
	 */
 	@PostMapping(path = "/delete")
	@ResponseBody
 	R<Object> deleteInfo(@RequestBody MqttUser mqttUser);
 	
 	/**
 	 * 重置客户端密码
 	 * @param mqttUser 客户端信息
 	 * @return R<Object> 处理结果
 	 *
 	 * @author zhouhui
 	 * @since 2024.02.22 
 	 */
 	@PostMapping(path = "/resetPassword")
	@ResponseBody
 	R<MqttUser> resetPassword(@RequestBody MqttUser mqttUser);
 }
 
